import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Bonus here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Bonus extends Actor
{
    /**
     * Act - do whatever the Bonus wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    protected  int num;
    
    public void act() 
    {
        // Add your action code here.
    } 
    public void move(int velocidad) {
        if (this.getX() == -50/*|| this.getX()== this.getWorld().getWidth()*/){//getWidth()/2),(getHeight()/2)
            getWorld().removeObject(this);
            return;
        }
        else{            
        Actor stickman= getOneIntersectingObject(Stickman.class);        
        if(stickman!=null){ 
            World aux=getWorld();
            ((StickmanWorld)aux).creaLetrero(1,2);
            getWorld().removeObject(this);return;
        }else{ setLocation(this.getX()-velocidad, this.getY());}
    }
}  
     
}
   
   
        
          
        
         
    
    
    

